package com.arpost.pages;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

import com.qualcomm.vuforia.samples.VideoPlayback.R;

public class AboutInfo extends Activity {

	private ImageView goBackButton;
	private ImageView playVideoButton;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.about_info);
		
		goBackButton = (ImageView) findViewById(R.id.button_about_go_back);
		goBackButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		playVideoButton = (ImageView) findViewById(R.id.about_video);
		playVideoButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				playVideo("tr");
			}
		});
	}
	

	private void playVideo(String resourceName) {
	    Intent videoPlaybackActivity = new Intent(this, VideoPlayer.class);
	    int res=this.getResources().getIdentifier(resourceName, "raw", getPackageName());
	    videoPlaybackActivity.putExtra("fileRes", res);
	    startActivity(videoPlaybackActivity);
	}
}
